package com.qingcloud.adminbackend.entity.message;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;

/**
 * 事件类型配置表
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_message_type_field")
public class SysMessageTypeField extends Model {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "事件类型ID")
    private Integer typeId;

    @ApiModelProperty(value = "属性节点ID")
    @NotNull(message = "属性节点ID不能为空！")
    private String nodeId;

    @ApiModelProperty(value = "属性父ID")
    private String parentId;

    @ApiModelProperty(value = "字段名称")
    private String fieldName;

    @ApiModelProperty(value = "属性描述")
    private String fieldDesc;

    @ApiModelProperty(value = "值类型 1-数字 2-字符串 3-对象 4-数组")
    private String valueType;

    @ApiModelProperty(value = "资源类型 1-文本 2-图片地址 3-图片Base64 4-视频地址")
    private String resourceType;

    @ApiModelProperty(value = "是否参数报警计算")
    private Boolean isCal;

    @ApiModelProperty("子节点")
    @TableField(exist = false)
    private List<SysMessageTypeField> children = new ArrayList<>();
}
